home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / spacei_1 / clcycbit.frm (.txt) next >
Encoding:
Visual Basic Form  |  1999-08-07  |  54.5 KB  |  1,527 lines

  1. VERSION 5.00
  2. Begin VB.Form FrmGameScreen 
  3.    BackColor       =   &H00000000&
  4.    Caption         =   "GameScreen"
  5.    ClientHeight    =   4800
  6.    ClientLeft      =   165
  7.    ClientTop       =   1320
  8.    ClientWidth     =   9480
  9.    ForeColor       =   &H00FF0000&
  10.    KeyPreview      =   -1  'True
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   320
  13.    ScaleMode       =   3  'Pixel
  14.    ScaleWidth      =   632
  15.    StartUpPosition =   2  'CenterScreen
  16.    Visible         =   0   'False
  17.    Begin VB.CommandButton CmdRules 
  18.       Caption         =   "&Rules"
  19.       Height          =   735
  20.       Left            =   120
  21.       TabIndex        =   12
  22.       Top             =   720
  23.       Width           =   1095
  24.    End
  25.    Begin VB.CommandButton CmdQuit 
  26.       Caption         =   "&Quit"
  27.       Height          =   615
  28.       Left            =   120
  29.       TabIndex        =   11
  30.       Tag             =   "SV"
  31.       ToolTipText     =   "I've ad enuff"
  32.       Top             =   1440
  33.       Width           =   1095
  34.    End
  35.    Begin VB.PictureBox PicRollUp 
  36.       Appearance      =   0  'Flat
  37.       BackColor       =   &H80000002&
  38.       BorderStyle     =   0  'None
  39.       DragMode        =   1  'Automatic
  40.       ForeColor       =   &H80000008&
  41.       Height          =   375
  42.       Left            =   7680
  43.       ScaleHeight     =   25
  44.       ScaleMode       =   3  'Pixel
  45.       ScaleWidth      =   105
  46.       TabIndex        =   7
  47.       Tag             =   "SV"
  48.       ToolTipText     =   "Move Me!"
  49.       Top             =   3000
  50.       Width           =   1575
  51.       Begin VB.CommandButton cmdDragenable 
  52.          Caption         =   "1"
  53.          Height          =   255
  54.          Left            =   1080
  55.          TabIndex        =   10
  56.          ToolTipText     =   "Stick to Screen"
  57.          Top             =   0
  58.          Width           =   255
  59.       End
  60.       Begin VB.CommandButton CmdToggle 
  61.          Caption         =   "X"
  62.          BeginProperty Font 
  63.             Name            =   "MS Sans Serif"
  64.             Size            =   8.25
  65.             Charset         =   0
  66.             Weight          =   700
  67.             Underline       =   0   'False
  68.             Italic          =   0   'False
  69.             Strikethrough   =   0   'False
  70.          EndProperty
  71.          Height          =   255
  72.          Left            =   1320
  73.          TabIndex        =   9
  74.          ToolTipText     =   "Toggle HighScore"
  75.          Top             =   0
  76.          Width           =   255
  77.       End
  78.       Begin VB.Label LblRollupCaption 
  79.          Alignment       =   2  'Center
  80.          BackStyle       =   0  'Transparent
  81.          Caption         =   "HIGHSCORE"
  82.          ForeColor       =   &H8000000E&
  83.          Height          =   255
  84.          Left            =   0
  85.          TabIndex        =   8
  86.          Tag             =   "SV"
  87.          Top             =   0
  88.          Width           =   1095
  89.       End
  90.    End
  91.    Begin VB.PictureBox PicClock 
  92.       Appearance      =   0  'Flat
  93.       AutoRedraw      =   -1  'True
  94.       BackColor       =   &H00000000&
  95.       BorderStyle     =   0  'None
  96.       ForeColor       =   &H80000008&
  97.       Height          =   1335
  98.       Left            =   8040
  99.       ScaleHeight     =   89
  100.       ScaleMode       =   3  'Pixel
  101.       ScaleWidth      =   89
  102.       TabIndex        =   6
  103.       Tag             =   "SV"
  104.       Top             =   720
  105.       Visible         =   0   'False
  106.       Width           =   1335
  107.       Begin VB.Line LinLongHand 
  108.          BorderColor     =   &H000000FF&
  109.          Tag             =   "SV"
  110.          X1              =   48
  111.          X2              =   48
  112.          Y1              =   8
  113.          Y2              =   40
  114.       End
  115.       Begin VB.Line LinPointerLeft 
  116.          BorderColor     =   &H000000FF&
  117.          Tag             =   "SV"
  118.          X1              =   48
  119.          X2              =   40
  120.          Y1              =   8
  121.          Y2              =   24
  122.       End
  123.       Begin VB.Line LinPointerRight 
  124.          BorderColor     =   &H000000FF&
  125.          Tag             =   "SV"
  126.          X1              =   48
  127.          X2              =   56
  128.          Y1              =   8
  129.          Y2              =   24
  130.       End
  131.       Begin VB.Shape ShpClockDot 
  132.          BorderStyle     =   0  'Transparent
  133.          FillColor       =   &H0200FF00&
  134.          FillStyle       =   0  'Solid
  135.          Height          =   255
  136.          Left            =   720
  137.          Shape           =   3  'Circle
  138.          Tag             =   "SV"
  139.          Top             =   600
  140.          Visible         =   0   'False
  141.          Width           =   135
  142.       End
  143.    End
  144.    Begin VB.Timer TmrStart 
  145.       Interval        =   50
  146.       Left            =   1680
  147.       Top             =   3480
  148.    End
  149.    Begin VB.Timer TmrEnd 
  150.       Enabled         =   0   'False
  151.       Interval        =   100
  152.       Left            =   1200
  153.       Top             =   3480
  154.    End
  155.    Begin VB.CommandButton CmdHiScore 
  156.       Caption         =   "&HiScore"
  157.       Height          =   615
  158.       Left            =   120
  159.       TabIndex        =   1
  160.       Tag             =   "SV"
  161.       Top             =   120
  162.       Visible         =   0   'False
  163.       Width           =   1095
  164.    End
  165.    Begin VB.Timer TmrEnergy1 
  166.       Enabled         =   0   'False
  167.       Interval        =   100
  168.       Left            =   240
  169.       Top             =   3120
  170.    End
  171.    Begin VB.Timer TmrClock 
  172.       Enabled         =   0   'False
  173.       Interval        =   1000
  174.       Left            =   720
  175.       Top             =   3480
  176.    End
  177.    Begin VB.Timer TmrPlayerMissile 
  178.       Enabled         =   0   'False
  179.       Interval        =   20
  180.       Left            =   240
  181.       Top             =   3480
  182.    End
  183.    Begin VB.Timer TmrMoveAliens 
  184.       Enabled         =   0   'False
  185.       Interval        =   150
  186.       Left            =   240
  187.       Top             =   2640
  188.    End
  189.    Begin VB.Timer TmrMissileAnimation2 
  190.       Enabled         =   0   'False
  191.       Interval        =   50
  192.       Left            =   240
  193.       Top             =   2160
  194.    End
  195.    Begin VB.Label lblHiScore 
  196.       Alignment       =   2  'Center
  197.       BackColor       =   &H80000002&
  198.       ForeColor       =   &H8000000E&
  199.       Height          =   2115
  200.       Left            =   7680
  201.       TabIndex        =   5
  202.       Top             =   3360
  203.       Visible         =   0   'False
  204.       Width           =   1605
  205.    End
  206.    Begin VB.Image Imgball 
  207.       Height          =   240
  208.       Index           =   4
  209.       Left            =   6225
  210.       Picture         =   "clcycbitbltform1.frx":0000
  211.       Top             =   2040
  212.       Visible         =   0   'False
  213.       Width           =   240
  214.    End
  215.    Begin VB.Image Imgball 
  216.       Height          =   240
  217.       Index           =   3
  218.       Left            =   5760
  219.       Picture         =   "clcycbitbltform1.frx":014A
  220.       Top             =   2040
  221.       Visible         =   0   'False
  222.       Width           =   240
  223.    End
  224.    Begin VB.Image Imgball 
  225.       Height          =   240
  226.       Index           =   2
  227.       Left            =   5400
  228.       Picture         =   "clcycbitbltform1.frx":0294
  229.       Top             =   2040
  230.       Visible         =   0   'False
  231.       Width           =   240
  232.    End
  233.    Begin VB.Image Imgball 
  234.       Height          =   240
  235.       Index           =   1
  236.       Left            =   5040
  237.       Picture         =   "clcycbitbltform1.frx":03DE
  238.       Top             =   2040
  239.       Visible         =   0   'False
  240.       Width           =   240
  241.    End
  242.    Begin VB.Image Imgball 
  243.       Height          =   240
  244.       Index           =   0
  245.       Left            =   3360
  246.       Picture         =   "clcycbitbltform1.frx":0528
  247.       Tag             =   "SV"
  248.       Top             =   1440
  249.       Visible         =   0   'False
  250.       Width           =   240
  251.    End
  252.    Begin VB.Image ImgWalker 
  253.       Appearance      =   0  'Flat
  254.       Height          =   480
  255.       Index           =   9
  256.       Left            =   7080
  257.       Picture         =   "clcycbitbltform1.frx":0672
  258.       Top             =   1920
  259.       Visible         =   0   'False
  260.       Width           =   480
  261.    End
  262.    Begin VB.Image ImgGuidedMissile 
  263.       Height          =   240
  264.       Index           =   2
  265.       Left            =   8760
  266.       Picture         =   "clcycbitbltform1.frx":097C
  267.       Top             =   2520
  268.       Visible         =   0   'False
  269.       Width           =   120
  270.    End
  271.    Begin VB.Image ImgGuidedMissile 
  272.       Height          =   240
  273.       Index           =   1
  274.       Left            =   8640
  275.       Picture         =   "clcycbitbltform1.frx":0A3E
  276.       Top             =   2520
  277.       Visible         =   0   'False
  278.       Width           =   60
  279.    End
  280.    Begin VB.Image ImgGuidedMissile 
  281.       Height          =   240
  282.       Index           =   0
  283.       Left            =   8400
  284.       Picture         =   "clcycbitbltform1.frx":0B00
  285.       Top             =   2520
  286.       Visible         =   0   'False
  287.       Width           =   60
  288.    End
  289.    Begin VB.Image ImgWalker 
  290.       Appearance      =   0  'Flat
  291.       Height          =   480
  292.       Index           =   8
  293.       Left            =   7440
  294.       Picture         =   "clcycbitbltform1.frx":0BC2
  295.       Top             =   1440
  296.       Visible         =   0   'False
  297.       Width           =   480
  298.    End
  299.    Begin VB.Image ImgWalker 
  300.       Appearance      =   0  'Flat
  301.       Height          =   480
  302.       Index           =   7
  303.       Left            =   6960
  304.       Picture         =   "clcycbitbltform1.frx":0ECC
  305.       Top             =   1440
  306.       Visible         =   0   'False
  307.       Width           =   480
  308.    End
  309.    Begin VB.Image ImgWalker 
  310.       Appearance      =   0  'Flat
  311.       Height          =   480
  312.       Index           =   6
  313.       Left            =   6600
  314.       Picture         =   "clcycbitbltform1.frx":11D6
  315.       Top             =   1320
  316.       Visible         =   0   'False
  317.       Width           =   480
  318.    End
  319.    Begin VB.Image ImgWalker 
  320.       Appearance      =   0  'Flat
  321.       Height          =   480
  322.       Index           =   5
  323.       Left            =   7440
  324.       Picture         =   "clcycbitbltform1.frx":14E0
  325.       Top             =   840
  326.       Visible         =   0   'False
  327.       Width           =   480
  328.    End
  329.    Begin VB.Image ImgWalker 
  330.       Appearance      =   0  'Flat
  331.       Height          =   480
  332.       Index           =   4
  333.       Left            =   6960
  334.       Picture         =   "clcycbitbltform1.frx":17EA
  335.       Top             =   840
  336.       Visible         =   0   'False
  337.       Width           =   480
  338.    End
  339.    Begin VB.Image ImgWalker 
  340.       Appearance      =   0  'Flat
  341.       Height          =   480
  342.       Index           =   3
  343.       Left            =   6600
  344.       Picture         =   "clcycbitbltform1.frx":1AF4
  345.       Top             =   840
  346.       Visible         =   0   'False
  347.       Width           =   480
  348.    End
  349.    Begin VB.Image ImgWalker 
  350.       Appearance      =   0  'Flat
  351.       Height          =   480
  352.       Index           =   2
  353.       Left            =   7560
  354.       Picture         =   "clcycbitbltform1.frx":1DFE
  355.       Top             =   240
  356.       Visible         =   0   'False
  357.       Width           =   480
  358.    End
  359.    Begin VB.Image ImgWalker 
  360.       Appearance      =   0  'Flat
  361.       Height          =   480
  362.       Index           =   1
  363.       Left            =   7080
  364.       Picture         =   "clcycbitbltform1.frx":2108
  365.       Top             =   240
  366.       Visible         =   0   'False
  367.       Width           =   480
  368.    End
  369.    Begin VB.Image ImgWalker 
  370.       Appearance      =   0  'Flat
  371.       Height          =   480
  372.       Index           =   0
  373.       Left            =   6600
  374.       Picture         =   "clcycbitbltform1.frx":2412
  375.       Top             =   240
  376.       Visible         =   0   'False
  377.       Width           =   480
  378.    End
  379.    Begin VB.Label LblTime 
  380.       Alignment       =   2  'Center
  381.       BackStyle       =   0  'Transparent
  382.       Caption         =   "0:0"
  383.       ForeColor       =   &H020000FF&
  384.       Height          =   495
  385.       Left            =   8040
  386.       TabIndex        =   4
  387.       Top             =   2160
  388.       Visible         =   0   'False
  389.       Width           =   1455
  390.    End
  391.    Begin VB.Label lblEndGame 
  392.       Alignment       =   2  'Center
  393.       BackStyle       =   0  'Transparent
  394.       Caption         =   "YOUR DEAD SUCKER!!!"
  395.       BeginProperty Font 
  396.          Name            =   "MS Sans Serif"
  397.          Size            =   24
  398.          Charset         =   0
  399.          Weight          =   400
  400.          Underline       =   0   'False
  401.          Italic          =   0   'False
  402.          Strikethrough   =   0   'False
  403.       EndProperty
  404.       ForeColor       =   &H020000FF&
  405.       Height          =   1335
  406.       Left            =   2640
  407.       TabIndex        =   3
  408.       Top             =   240
  409.       Visible         =   0   'False
  410.       Width           =   3915
  411.    End
  412.    Begin VB.Image ImgPlayerMissile 
  413.       Height          =   240
  414.       Index           =   4
  415.       Left            =   8040
  416.       Picture         =   "clcycbitbltform1.frx":271C
  417.       Top             =   2280
  418.       Visible         =   0   'False
  419.       Width           =   240
  420.    End
  421.    Begin VB.Image ImgPlayerMissile 
  422.       Height          =   240
  423.       Index           =   3
  424.       Left            =   8280
  425.       Picture         =   "clcycbitbltform1.frx":2866
  426.       Top             =   2520
  427.       Visible         =   0   'False
  428.       Width           =   60
  429.    End
  430.    Begin VB.Label lblScore 
  431.       Alignment       =   2  'Center
  432.       BackStyle       =   0  'Transparent
  433.       BorderStyle     =   1  'Fixed Single
  434.       Caption         =   "Lives 3"
  435.       ForeColor       =   &H020000FF&
  436.       Height          =   375
  437.       Index           =   5
  438.       Left            =   8160
  439.       TabIndex        =   2
  440.       Tag             =   "SV"
  441.       Top             =   360
  442.       Visible         =   0   'False
  443.       Width           =   1335
  444.    End
  445.    Begin VB.Image ImgAlien 
  446.       Height          =   240
  447.       Index           =   16
  448.       Left            =   5040
  449.       Picture         =   "clcycbitbltform1.frx":2928
  450.       Tag             =   "SV"
  451.       Top             =   1200
  452.       Visible         =   0   'False
  453.       Width           =   240
  454.    End
  455.    Begin VB.Image ImgAlien 
  456.       Height          =   240
  457.       Index           =   15
  458.       Left            =   4320
  459.       Picture         =   "clcycbitbltform1.frx":2A72
  460.       Tag             =   "SV"
  461.       Top             =   1170
  462.       Visible         =   0   'False
  463.       Width           =   240
  464.    End
  465.    Begin VB.Image ImgAlien 
  466.       Height          =   240
  467.       Index           =   14
  468.       Left            =   3720
  469.       Picture         =   "clcycbitbltform1.frx":2BBC
  470.       Tag             =   "SV"
  471.       Top             =   1080
  472.       Visible         =   0   'False
  473.       Width           =   240
  474.    End
  475.    Begin VB.Image ImgAlien 
  476.       Height          =   240
  477.       Index           =   13
  478.       Left            =   3000
  479.       Picture         =   "clcycbitbltform1.frx":2D06
  480.       Tag             =   "SV"
  481.       Top             =   1080
  482.       Visible         =   0   'False
  483.       Width           =   240
  484.    End
  485.    Begin VB.Image ImgAlien 
  486.       Height          =   240
  487.       Index           =   12
  488.       Left            =   2280
  489.       Picture         =   "clcycbitbltform1.frx":2E50
  490.       Tag             =   "SV"
  491.       Top             =   1080
  492.       Visible         =   0   'False
  493.       Width           =   240
  494.    End
  495.    Begin VB.Image ImgAlien 
  496.       Height          =   240
  497.       Index           =   11
  498.       Left            =   1560
  499.       Picture         =   "clcycbitbltform1.frx":2F9A
  500.       Tag             =   "SV"
  501.       Top             =   1080
  502.       Visible         =   0   'False
  503.       Width           =   240
  504.    End
  505.    Begin VB.Image ImgPlayer 
  506.       Height          =   480
  507.       Index           =   5
  508.       Left            =   5880
  509.       Picture         =   "clcycbitbltform1.frx":30E4
  510.       Top             =   4200
  511.       Visible         =   0   'False
  512.       Width           =   480
  513.    End
  514.    Begin VB.Image imgAlienMissile 
  515.       Height          =   240
  516.       Left            =   5040
  517.       Picture         =   "clcycbitbltform1.frx":33EE
  518.       Top             =   3120
  519.       Visible         =   0   'False
  520.       Width           =   120
  521.    End
  522.    Begin VB.Image img100 
  523.       Height          =   240
  524.       Index           =   3
  525.       Left            =   6000
  526.       Picture         =   "clcycbitbltform1.frx":34F8
  527.       Top             =   3360
  528.       Visible         =   0   'False
  529.       Width           =   240
  530.    End
  531.    Begin VB.Image img100 
  532.       Height          =   240
  533.       Index           =   2
  534.       Left            =   5640
  535.       Picture         =   "clcycbitbltform1.frx":3642
  536.       Top             =   3360
  537.       Visible         =   0   'False
  538.       Width           =   240
  539.    End
  540.    Begin VB.Image img100 
  541.       Height          =   240
  542.       Index           =   1
  543.       Left            =   5280
  544.       Picture         =   "clcycbitbltform1.frx":378C
  545.       Top             =   3360
  546.       Visible         =   0   'False
  547.       Width           =   240
  548.    End
  549.    Begin VB.Image img100 
  550.       Height          =   240
  551.       Index           =   0
  552.       Left            =   4920
  553.       Picture         =   "clcycbitbltform1.frx":38D6
  554.       Top             =   3360
  555.       Visible         =   0   'False
  556.       Width           =   240
  557.    End
  558.    Begin VB.Image ImgPlayer 
  559.       Height          =   480
  560.       Index           =   4
  561.       Left            =   5280
  562.       Picture         =   "clcycbitbltform1.frx":3A20
  563.       Top             =   4200
  564.       Visible         =   0   'False
  565.       Width           =   480
  566.    End
  567.    Begin VB.Image ImgPlayer 
  568.       Height          =   480
  569.       Index           =   3
  570.       Left            =   4800
  571.       Picture         =   "clcycbitbltform1.frx":3D2A
  572.       Top             =   4200
  573.       Visible         =   0   'False
  574.       Width           =   480
  575.    End
  576.    Begin VB.Image ImgPlayer 
  577.       Height          =   480
  578.       Index           =   2
  579.       Left            =   4320
  580.       Picture         =   "clcycbitbltform1.frx":4034
  581.       Top             =   4200
  582.       Visible         =   0   'False
  583.       Width           =   480
  584.    End
  585.    Begin VB.Image ImgPlayer 
  586.       Height          =   480
  587.       Index           =   1
  588.       Left            =   3720
  589.       Picture         =   "clcycbitbltform1.frx":433E
  590.       Top             =   4200
  591.       Visible         =   0   'False
  592.       Width           =   480
  593.    End
  594.    Begin VB.Image ImgAlienPic 
  595.       Height          =   240
  596.       Index           =   2
  597.       Left            =   960
  598.       Picture         =   "clcycbitbltform1.frx":4648
  599.       Top             =   4200
  600.       Visible         =   0   'False
  601.       Width           =   240
  602.    End
  603.    Begin VB.Image ImgPlayerMissile 
  604.       Height          =   240
  605.       Index           =   2
  606.       Left            =   8160
  607.       Picture         =   "clcycbitbltform1.frx":4792
  608.       Top             =   2640
  609.       Visible         =   0   'False
  610.       Width           =   60
  611.    End
  612.    Begin VB.Image ImgPlayerMissile 
  613.       Height          =   240
  614.       Index           =   1
  615.       Left            =   8040
  616.       Picture         =   "clcycbitbltform1.frx":4854
  617.       Top             =   2520
  618.       Visible         =   0   'False
  619.       Width           =   60
  620.    End
  621.    Begin VB.Image ImgPlayerMissile 
  622.       Height          =   240
  623.       Index           =   0
  624.       Left            =   7080
  625.       Picture         =   "clcycbitbltform1.frx":4916
  626.       Top             =   2760
  627.       Visible         =   0   'False
  628.       Width           =   60
  629.    End
  630.    Begin VB.Image ImgPlayer 
  631.       Height          =   480
  632.       Index           =   0
  633.       Left            =   3000
  634.       Picture         =   "clcycbitbltform1.frx":49D8
  635.       Tag             =   "SV"
  636.       ToolTipText     =   "ALT+up arrow to fire"
  637.       Top             =   4200
  638.       Width           =   480
  639.    End
  640.    Begin VB.Image ImgAlien 
  641.       Height          =   240
  642.       Index           =   10
  643.       Left            =   4680
  644.       Picture         =   "clcycbitbltform1.frx":4CE2
  645.       Tag             =   "SV"
  646.       Top             =   720
  647.       Visible         =   0   'False
  648.       Width           =   240
  649.    End
  650.    Begin VB.Image ImgAlien 
  651.       Height          =   240
  652.       Index           =   9
  653.       Left            =   3960
  654.       Picture         =   "clcycbitbltform1.frx":4E2C
  655.       Tag             =   "SV"
  656.       Top             =   720
  657.       Visible         =   0   'False
  658.       Width           =   240
  659.    End
  660.    Begin VB.Image ImgAlien 
  661.       Height          =   240
  662.       Index           =   8
  663.       Left            =   3360
  664.       Picture         =   "clcycbitbltform1.frx":4F76
  665.       Tag             =   "SV"
  666.       Top             =   720
  667.       Visible         =   0   'False
  668.       Width           =   240
  669.    End
  670.    Begin VB.Image ImgAlien 
  671.       Height          =   240
  672.       Index           =   7
  673.       Left            =   2640
  674.       Picture         =   "clcycbitbltform1.frx":50C0
  675.       Tag             =   "SV"
  676.       Top             =   720
  677.       Visible         =   0   'False
  678.       Width           =   240
  679.    End
  680.    Begin VB.Image ImgAlien 
  681.       Height          =   240
  682.       Index           =   6
  683.       Left            =   1920
  684.       Picture         =   "clcycbitbltform1.frx":520A
  685.       Tag             =   "SV"
  686.       Top             =   720
  687.       Visible         =   0   'False
  688.       Width           =   240
  689.    End
  690.    Begin VB.Image ImgAlien 
  691.       Height          =   240
  692.       Index           =   5
  693.       Left            =   5040
  694.       Picture         =   "clcycbitbltform1.frx":5354
  695.       Top             =   120
  696.       Visible         =   0   'False
  697.       Width           =   240
  698.    End
  699.    Begin VB.Image ImgAlien 
  700.       Height          =   240
  701.       Index           =   4
  702.       Left            =   4320
  703.       Picture         =   "clcycbitbltform1.frx":549E
  704.       Top             =   120
  705.       Visible         =   0   'False
  706.       Width           =   240
  707.    End
  708.    Begin VB.Image ImgAlien 
  709.       Height          =   240
  710.       Index           =   3
  711.       Left            =   3720
  712.       Picture         =   "clcycbitbltform1.frx":55E8
  713.       Tag             =   "SV"
  714.       Top             =   120
  715.       Visible         =   0   'False
  716.       Width           =   240
  717.    End
  718.    Begin VB.Image ImgAlienPic 
  719.       Height          =   240
  720.       Index           =   1
  721.       Left            =   600
  722.       Picture         =   "clcycbitbltform1.frx":5732
  723.       Top             =   4080
  724.       Visible         =   0   'False
  725.       Width           =   240
  726.    End
  727.    Begin VB.Image ImgAlien 
  728.       Height          =   240
  729.       Index           =   2
  730.       Left            =   3000
  731.       Picture         =   "clcycbitbltform1.frx":587C
  732.       Tag             =   "SV"
  733.       Top             =   120
  734.       Visible         =   0   'False
  735.       Width           =   240
  736.    End
  737.    Begin VB.Image ImgAlien 
  738.       Height          =   240
  739.       Index           =   1
  740.       Left            =   2280
  741.       Picture         =   "clcycbitbltform1.frx":59C6
  742.       Tag             =   "SV"
  743.       Top             =   120
  744.       Visible         =   0   'False
  745.       Width           =   240
  746.    End
  747.    Begin VB.Image ImgAlien 
  748.       Height          =   240
  749.       Index           =   0
  750.       Left            =   1560
  751.       Picture         =   "clcycbitbltform1.frx":5B10
  752.       Tag             =   "SV"
  753.       Top             =   120
  754.       Visible         =   0   'False
  755.       Width           =   240
  756.    End
  757.    Begin VB.Image ImgAlienPic 
  758.       Height          =   240
  759.       Index           =   0
  760.       Left            =   360
  761.       Picture         =   "clcycbitbltform1.frx":5C5A
  762.       Top             =   4080
  763.       Visible         =   0   'False
  764.       Width           =   240
  765.    End
  766.    Begin VB.Label lblScore 
  767.       Alignment       =   2  'Center
  768.       BackStyle       =   0  'Transparent
  769.       BorderStyle     =   1  'Fixed Single
  770.       Caption         =   "0"
  771.       ForeColor       =   &H020000FF&
  772.       Height          =   375
  773.       Index           =   4
  774.       Left            =   8160
  775.       TabIndex        =   0
  776.       Tag             =   "SV"
  777.       Top             =   0
  778.       Visible         =   0   'False
  779.       Width           =   1335
  780.    End
  781. Attribute VB_Name = "FrmGameScreen"
  782. Attribute VB_GlobalNameSpace = False
  783. Attribute VB_Creatable = False
  784. Attribute VB_PredeclaredId = True
  785. Attribute VB_Exposed = False
  786. '********************SPACEINVADERS----by Sergio Perciballi***********
  787. '                    Date 14/Nov/1998  email oigres@postmaster.co.uk
  788. 'Program ---recreation of classic 1979 game;animated splash
  789. 'This module====FrmGameScreen------Game Screen-------------
  790. 'Version5---added-:playerslip;clock;3 bullets on screen
  791. 'aliens improved redraw by visible/false/true on every move
  792. 'variables need to be declared
  793. 'New!!! detectcollision routine in module-simpler code
  794. 'eccentric alien movements!!!!
  795. 'version 6- new highscore rollup
  796. 'Last Version-30/jan/99- separate FrmScore containing players scores,names
  797. 'Better collision Detection: player type in .bas module public variable
  798. Option Explicit
  799. Dim dx, dy, x2, alienNo, alienDx, GmPic, Pic As Integer
  800. Dim missile, barrel(2) As Integer  'missile index; barrel to keep them in
  801. Dim dead(16), allkilled As Boolean
  802. Dim score, lives, BulletIndex, BulletOff, plyrmssl
  803. Dim alienmovetype As Long
  804. Dim hiscore(19) As Long 'array to store scores
  805. Dim hiname(19) As String ' to store names in hi score
  806. Dim xm, ym ' mouse co-ordinates to store for rollup
  807. Dim sec, ballpic
  808. 'Public Declare Function DrawTextEx Lib "user32" Alias "DrawTextExA" (ByVal hDC As Long, ByVal lpsz As String, ByVal n As Long, lpRect As RECT, ByVal un As Long, lpDrawTextParams As DRAWTEXTPARAMS) As Long
  809. Dim NoAliens, energy, PlayerDx As Long 'possible optimize as long
  810. Dim alienfire, CanFire, StopMoving, walker, FireGuidedMissile As Boolean
  811. Dim x 'for clock
  812. Private Sub CmdRules_Click()
  813. 'display rules in message box
  814.     MsgBox "Alt+right arrow to move ->" & vbCr _
  815.     & "Alt+Left arrow to move <-" & vbCr _
  816.     & "Alt+Up arrow to fire ^"
  817. End Sub 'cmdrules
  818. Private Sub Form_Load()
  819. 'form_load also executes when we unload then show form
  820. Dim index
  821.     'FrmGameScreen.Show
  822.     'slip of player
  823.     StopMoving = False
  824.     energy = 5: score = 0
  825.     plyrmssl = 0: FireGuidedMissile = False: GmPic = 1
  826.     'setup variables
  827.     walker = False: CanFire = True: alienfire = False: NoAliens = 16: '0-16
  828.     alienmovetype = 2 'start up down
  829.     BulletIndex = 0: BulletOff = 0: allkilled = False
  830.     Randomize:  Pic = 0: sec = 0: ballpic = 1
  831.     missile = 0: For index = 0 To 2: barrel(index) = 0: Next
  832.     'array for dead aliens
  833.     For index = 0 To 16: dead(index) = False: Next
  834.     lives = 3
  835.     'direction vectors for change in ball movement
  836.     dx = 8: dy = 8
  837.     'hiscore table -1000 low for comparison
  838.     For index = 0 To 19: hiscore(index) = -1000: Next
  839.     'players names
  840.     For index = 0 To 3
  841.         players(index).name = "player" & index + 1
  842.         players(index).score = 0
  843.         'initial value of labels
  844.         FrmScores.lblPlayer(index).Caption = players(index).name
  845.         FrmScores.lblScore(index).Caption = players(index).score
  846.     Next
  847.     alienDx = 8
  848. End Sub
  849. Private Sub cmdDragenable_Click()
  850.     'rollup for hiscore if you click button
  851.     'then make it stick to screen -like corel draw! palettes
  852.     If PicRollUp.DragMode = 1 Then
  853.         PicRollUp.DragMode = 0 'no dragable
  854.         cmdDragenable.Caption = "0"
  855.     Else
  856.         PicRollUp.DragMode = 1 'yes dragable
  857.         cmdDragenable.Caption = "1"
  858.     End If
  859. End Sub
  860. Private Sub PicRollUp_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
  861.     'position of mouse when you click and drag-mouse move seems
  862.     'to stop when you drag
  863.     xm = x: ym = y
  864. End Sub
  865. Private Sub CmdToggle_Click()
  866.     lblHiScore.Visible = Not lblHiScore.Visible 'invert visibility
  867. End Sub
  868. Private Sub Form_DragDrop(Source As Control, x As Single, y As Single)
  869.     'move dragged component :place label just below it
  870.     Source.Left = x - xm
  871.     Source.Top = y - ym
  872.     lblHiScore.Left = x - xm
  873.     lblHiScore.Top = y + PicRollUp.Height - ym
  874. End Sub 'formDragdrop
  875. Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
  876. 'move bat move if alt shift or control and arrow keys
  877. 'keycode lets me get arrow keys and test shift
  878. 'need to have key up and key down event handled
  879. 'vbKeyLeft-left arrow; vbKeyRight-rightarrow; vbKeyUp are codes for arrow keys constants
  880.     ImgPlayer(0).Visible = False
  881.     If Shift And vbAltMask Then ' if alt key down
  882.         If KeyCode = vbKeyRight And ImgPlayer(0).Left < 600 Then
  883.             ImgPlayer(0).Left = ImgPlayer(0).Left + energy
  884.             ImgPlayer(0).Picture = ImgPlayer(3).Picture
  885.             PlayerDx = 0
  886.             'move with increase in energy
  887.             If energy <= 20 Then energy = energy + 1
  888.         End If
  889.         
  890.         If KeyCode = vbKeyLeft And ImgPlayer(0).Left > 0 Then
  891.             ImgPlayer(0).Left = ImgPlayer(0).Left - energy
  892.             ImgPlayer(0).Picture = ImgPlayer(2).Picture
  893.             PlayerDx = -1
  894.             'move with increase in energy
  895.             If energy <= 20 Then energy = energy + 1
  896.         End If
  897.         
  898.         'move bat; will be firing gun
  899.         If KeyCode = vbKeyUp Then
  900.             ImgPlayer(0).Picture = ImgPlayer(4)
  901.             fireplayermissile
  902.         End If
  903.     End If
  904.     ImgPlayer(0).Visible = True
  905.     StopMoving = False
  906. End Sub
  907. Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
  908. 'keycode lets me get arrow keys and test shift
  909. 'vbKeyLeft vbKeyRight vbKeyUp are codes for arrow keys constants
  910.     ImgPlayer(0).Visible = False
  911.     If Shift And vbAltMask Then
  912.          If KeyCode = vbKeyRight And ImgPlayer(0).Left < 600 Then
  913.              'ImgPlayer(0).Left = ImgPlayer(0).Left + energy
  914.              ImgPlayer(0).Picture = ImgPlayer(1).Picture
  915.              PlayerDx = 0
  916.          End If
  917.          If KeyCode = vbKeyLeft And ImgPlayer(0).Left > 0 Then
  918.              'ImgPlayer(0).Left = ImgPlayer(0).Left - energy
  919.              PlayerDx = -1
  920.              ImgPlayer(0).Picture = ImgPlayer(1).Picture
  921.          End If
  922.         
  923.         'restore player pic
  924.          If KeyCode = vbKeyUp Then
  925.              ImgPlayer(0).Picture = ImgPlayer(1)
  926.              'fireplayermissile
  927.          End If
  928.     End If
  929.     ImgPlayer(0).Visible = True
  930.     StopMoving = True
  931. End Sub
  932. Private Sub fireplayermissile()
  933. 'fire playermissile
  934. 'limited to 3 shots on screen
  935. 'takeout bullet
  936.    If CanFire Then
  937.        If BulletIndex < 3 Then
  938.            If BulletOff <= 3 Then
  939.        
  940.        
  941.                ImgPlayerMissile(BulletIndex).Picture = ImgPlayerMissile(3).Picture
  942.            
  943.                'place playermissile above player
  944.                ImgPlayerMissile(BulletIndex).Left = ImgPlayer(0).Left + 8
  945.                ImgPlayerMissile(BulletIndex).Top = ImgPlayer(0).Top - ImgPlayerMissile(BulletIndex).Height
  946.                ImgPlayerMissile(BulletIndex).Visible = True
  947.            
  948.                BulletIndex = BulletIndex + 1
  949.            End If
  950.        End If
  951.    End If
  952.    If BulletIndex >= 3 Then
  953.        CanFire = False
  954.    End If
  955. End Sub
  956. Private Sub TmrEnergy1_Timer()
  957.     'if stopkeypress then move player reducing his energy
  958.     If StopMoving Then
  959.         If energy > 0 Then
  960.             ImgPlayer(0).Visible = False
  961.             If PlayerDx = -1 Then
  962.                 If ImgPlayer(0).Left >= 0 Then ImgPlayer(0).Left = ImgPlayer(0).Left - energy
  963.             Else
  964.                 If ImgPlayer(0).Left <= ScaleWidth Then ImgPlayer(0).Left = ImgPlayer(0).Left + energy
  965.             End If
  966.             energy = energy * 90 / 100
  967.             ImgPlayer(0).Visible = True
  968.         Else
  969.             'drained of energy
  970.             energy = 5
  971.             StopMoving = False
  972.         End If
  973.     End If
  974. End Sub
  975. Private Sub TmrClock_Timer()
  976.     Dim rad, cradius, cx, cy
  977.     Dim degreetorad, clockangle, offsetp
  978.     Dim radius, radiusp, handx, handy
  979.     'cradius=radius of clock face
  980.     cradius = 25: cx = 50: cy = 50
  981.     'place dot on face of clock
  982.     ShpClockDot.Left = cx - (ShpClockDot.Width / 2)
  983.     ShpClockDot.Top = cy - (ShpClockDot.Height / 2)
  984.     'draw lines on face of clock
  985.     PicClock.Visible = False 'container off
  986.     For x = 0 To 360 'degrees
  987.         rad = x / 180 * 3.14 + 3.9 'degree to radians + offset 3.9
  988.         If x Mod 6 = 0 Then 'every 6 degrees= 60 divisions
  989.             PicClock.PSet ((cradius * Cos(rad)) - (cradius * Sin(rad)) + cx, (cradius * Sin(rad)) + (cradius * Cos(rad)) + cy), &HFFF00
  990.         End If
  991.         If x Mod 30 = 0 Then 'every 30 degrees= 12 divisions(12 numbers on clock)
  992.             PicClock.CurrentX = (20 * Cos(rad)) - (20 * Sin(rad)) + cx
  993.             PicClock.CurrentY = (20 * Sin(rad)) + (20 * Cos(rad)) + cy
  994.             PicClock.Line -((cradius * Cos(rad)) - (cradius * Sin(rad)) + cx, (cradius * Sin(rad)) + (cradius * Cos(rad)) + cy), &HFF00
  995.         End If 'longer line on clock dial in green
  996.     Next
  997.     'turn off lables ,hands
  998.     LblTime.Visible = False
  999.     'LinLongHand.Visible = False
  1000.     'LinPointerLeft.Visible = False
  1001.     'LinPointerRight.Visible = False
  1002.     radius = 20: radiusp = 15: offsetp = 0.1
  1003.     clockangle = (6 * sec) '60sec 6*60=360=degrees
  1004.     degreetorad = (clockangle / 180) * 3.14 + 3.9 'change degreetorad
  1005.     'minutes   and seconds in label \=integer div
  1006.     LblTime.Caption = (sec \ 60) & ":" & (sec Mod 60)
  1007.     LinLongHand.X1 = 50: LinLongHand.Y1 = 50
  1008.     'end of clock hand near dots
  1009.     handx = (radius * Cos(degreetorad)) - (radius * Sin(degreetorad)) + 50
  1010.     handy = (radius * Sin(degreetorad)) + (radius * Cos(degreetorad)) + 50
  1011.     LinLongHand.x2 = handx
  1012.     LinLongHand.Y2 = handy
  1013.     'left pointer bit
  1014.     LinPointerLeft.X1 = handx: LinPointerLeft.Y1 = handy
  1015.     LinPointerLeft.x2 = (radiusp * Cos(degreetorad - offsetp)) - (radiusp * Sin(degreetorad - offsetp)) + 50
  1016.     LinPointerLeft.Y2 = (radiusp * Sin(degreetorad - offsetp)) + (radiusp * Cos(degreetorad - offsetp)) + 50
  1017.     'right pointer bit
  1018.     LinPointerRight.X1 = handx: LinPointerRight.Y1 = handy
  1019.     LinPointerRight.x2 = (radiusp * Cos(degreetorad + offsetp)) - (radiusp * Sin(degreetorad + offsetp)) + 50
  1020.     LinPointerRight.Y2 = (radiusp * Sin(degreetorad + offsetp)) + (radiusp * Cos(degreetorad + offsetp)) + 50
  1021.     'turn on lables ,hands
  1022.     PicClock.Visible = True 'container on
  1023.     LblTime.Visible = True
  1024.     'LinLongHand.Visible = True
  1025.     'LinPointerLeft.Visible = True
  1026.     'LinPointerRight.Visible = True
  1027.     sec = sec + 1 'increase every second
  1028. End Sub 'TmrClock
  1029. Private Sub TmrEnd_Timer()
  1030.     'exit prog if click no
  1031.     Static index, counter
  1032.         'controls=collection of controls on form
  1033.         If index = Controls.Count Then
  1034.             Unload Me 'cleanup
  1035.             Set FrmGameScreen = Nothing
  1036.             End
  1037.         End If
  1038.         'avoid timers as they can't be made invisible
  1039.         If (TypeOf Controls(index) Is Label) Or (TypeOf Controls(index) Is CommandButton) _
  1040.         Or (TypeOf Controls(index) Is Image) Or (TypeOf Controls(index) Is PictureBox) _
  1041.         Then
  1042.             FrmGameScreen.Controls(index).Visible = False
  1043.         End If
  1044.         'MsgBox "index="
  1045.         'Debug.Print index; Controls.Count
  1046.         index = index + 1
  1047.         
  1048. End Sub 'TmrEnd
  1049. Private Sub TmrPlayerMissile_Timer()
  1050. Dim index, topmissile
  1051. Static WalkerPic
  1052. 'PlayerMissile if on screen then
  1053. 'move up screen
  1054. 'move alien missile down screen also
  1055.     TurnOnAlienMissile ' call alien missile movers
  1056.     'playermissile====================
  1057.     For index = 0 To 2
  1058.         If ImgPlayerMissile(index).Visible = True Then
  1059.         'move missile to top of screen
  1060.             ImgPlayerMissile(index).Visible = False
  1061.             ImgPlayerMissile(index).Top = ImgPlayerMissile(index).Top - 6
  1062.             ImgPlayerMissile(index).Visible = True
  1063.         End If
  1064.         If ImgPlayerMissile(index).Top <= 0 Then
  1065.             If ImgPlayerMissile(index).Visible Then
  1066.                 BulletOff = BulletOff + 1
  1067.             End If
  1068.             ImgPlayerMissile(index).Visible = False
  1069.             
  1070.         End If
  1071.     Next index
  1072.     'walker animation and move conditions
  1073.     If walker And ImgWalker(0).Visible Then
  1074.         WalkerPic = WalkerPic + 1
  1075.         If WalkerPic > 8 Then WalkerPic = 1
  1076.         ImgWalker(0).Visible = False 'draw optimization
  1077.         ImgWalker(0).Picture = ImgWalker(WalkerPic).Picture
  1078.         ImgWalker(0).Move ImgWalker(0).Left + 2
  1079.         ImgWalker(0).Visible = True
  1080.         If ImgWalker(0).Left > ScaleWidth Then
  1081.             ImgWalker(0).Visible = False
  1082.             walker = False
  1083.         End If
  1084.     End If
  1085.     If FireGuidedMissile Then
  1086.         ImgGuidedMissile(0).Visible = False
  1087.         If ImgGuidedMissile(0).Left > ImgPlayer(0).Left + 8 Then
  1088.             ImgGuidedMissile(0).Left = ImgGuidedMissile(0).Left - 2
  1089.         End If
  1090.         'offsets of 8 to center missile
  1091.         If ImgGuidedMissile(0).Left < ImgPlayer(0).Left + 8 Then
  1092.             ImgGuidedMissile(0).Left = ImgGuidedMissile(0).Left + 2
  1093.         End If
  1094.         If ImgGuidedMissile(0).Top < ImgPlayer(0).Top Then
  1095.             ImgGuidedMissile(0).Top = ImgGuidedMissile(0).Top + 2
  1096.         End If
  1097.         'flip pictures
  1098.         If GmPic = 1 Then
  1099.             GmPic = 2
  1100.         Else
  1101.             GmPic = 1
  1102.         End If
  1103.         ImgGuidedMissile(0).Picture = ImgGuidedMissile(GmPic).Picture
  1104.         ImgGuidedMissile(0).Visible = True
  1105.     End If
  1106. End Sub 'TmrPlayerMissile
  1107. Private Sub TurnOnAlienMissile()
  1108. Dim index As Integer
  1109.     If alienfire Then
  1110.         index = Int(NoAliens * Rnd)
  1111.             'see if alien alive
  1112.             If ImgAlien(index).Visible And Not dead(index) Then
  1113.                 If imgAlienMissile.Visible = False Then
  1114.                     imgAlienMissile.Left = ImgAlien(index).Left
  1115.                     imgAlienMissile.Top = ImgAlien(index).Top
  1116.                     imgAlienMissile.Visible = True
  1117.                     alienfire = False
  1118.                 End If
  1119.        
  1120.             End If
  1121.     End If
  1122.     If imgAlienMissile.Visible Then
  1123.     'move alien missile
  1124.         imgAlienMissile.Visible = False
  1125.         imgAlienMissile.Top = imgAlienMissile.Top + 4
  1126.         imgAlienMissile.Visible = True
  1127.         If imgAlienMissile.Top > ScaleHeight Then 'if off bottom
  1128.             imgAlienMissile.Visible = False
  1129.         End If
  1130.     End If
  1131. End Sub 'turnonalienmissile
  1132. Private Sub TmrMissileAnimation2_Timer()
  1133. 'alien missile animation
  1134. 'resetpic
  1135. 'ImgPlayerMissile(0).Picture = ImgPlayerMissile(3).Picture
  1136.     'ImgPlayerMissile(0).Top = -1
  1137.     ImgPlayerMissile(plyrmssl).Visible = False
  1138.     'me off
  1139.     TmrMissileAnimation2.Enabled = False
  1140. End Sub 'TmrMissileAnimation2
  1141. Private Sub TmrMoveAliens_Timer()
  1142. 'main moves of aliens
  1143.     Dim shpcenterx, shpcentery, alien
  1144.     Dim index As Long 'optimize?
  1145.     MoveBall ' call ball move and detect subroutines
  1146. '****************move aliens 3right/left then down ;no of aliens
  1147.     For index = 0 To NoAliens
  1148.         'if alien alive and on screen
  1149.         If dead(index) = False Then
  1150.             'test if over sides: move down if over
  1151.             If ImgAlien(index).Left > 500 And alienDx = 8 Then
  1152.                 alienDx = -8
  1153.                 AlienDownMove
  1154.             End If
  1155.             If ImgAlien(index).Left < 90 And alienDx = -8 Then
  1156.                 alienDx = 8
  1157.                 AlienDownMove
  1158.             End If
  1159.             'see if aliens level with player - can't kill them so end game
  1160.             If ImgAlien(index).Top >= ImgPlayer(0).Top Then
  1161.                 EndGame ("Alien on your level:Another Game?")
  1162.                 Exit Sub 'get out of sub
  1163.             End If
  1164.         Else
  1165.             TurnAlienToScore (index)
  1166.             
  1167.         End If 'end if alive
  1168.        'change picture on aliens-------------------------------
  1169.         If Pic = 0 Then
  1170.                 Pic = 1
  1171.         Else
  1172.                 Pic = 0
  1173.         End If
  1174.         AlienMoveRoutines (index) 'lefttoright circle and half circle moves
  1175.         'call procs to detect if hit
  1176.         DetectCollisionPlayerMissileAlien (index)
  1177.         DetectCollisionAlienPlayer
  1178.     Next index 'for each alien
  1179.     'randomly let aliens fire if num=2
  1180.     'If Int(Rnd * 3) = 2 Then
  1181.         If imgAlienMissile.Visible = False Then
  1182.             alienfire = True
  1183.         End If
  1184.     'End If
  1185.     If walker = False And Int(Rnd * 51) = 50 Then
  1186.         walker = True
  1187.         ImgWalker(0).Visible = True
  1188.         ImgWalker(0).Left = 80
  1189.         ImgWalker(0).Top = 10
  1190.     End If
  1191.     'fire guided missile
  1192.     If walker = True And FireGuidedMissile = False And Int(Rnd * 51) = 50 Then
  1193.         FireGuidedMissile = True
  1194.         ImgGuidedMissile(0).Visible = True
  1195.         ImgGuidedMissile(0).Left = ImgWalker(0).Left
  1196.         ImgGuidedMissile(0).Top = ImgWalker(0).Top + ImgWalker(0).Height
  1197.     End If
  1198. End Sub 'TmrMovealiens
  1199. Private Sub MoveBall()
  1200. 'move ball, check if center of ball overlaps; not gone past bottom edge
  1201.     If Imgball(0).Left < 0 Then dx = 8: Beep
  1202.     If Imgball(0).Top < 0 Then dy = 8: Beep
  1203.     If Imgball(0).Left + Imgball(0).Width > ScaleWidth Then dx = -8: Beep
  1204.     'if ball overlaps the player then reverse y direction
  1205.     If detectcol(Imgball(0), ImgPlayer(0)) Then
  1206.         dy = -8
  1207.     End If
  1208.     'move ball turn off then on to improve draw speed
  1209.     Imgball(0).Visible = False
  1210.     Imgball(0).Move Imgball(0).Left + dx, Imgball(0).Top + dy
  1211.     'move through pictures of rotating ball
  1212.     ballpic = ballpic + 1
  1213.     If ballpic > 4 Then ballpic = 1
  1214.     Imgball(0).Picture = Imgball(ballpic).Picture
  1215.     'turn on
  1216.     Imgball(0).Visible = True
  1217.     'if ball gone past without hit
  1218.     ' end game-----------
  1219.     If Imgball(0).Top > ScaleHeight Then
  1220.         EndGame ("Ball Lost!!! Another Game?")
  1221.         Exit Sub
  1222.     End If
  1223. End Sub 'MoveBall
  1224. Private Sub AlienMoveRoutines(ByVal index)
  1225.         Dim yaliendy, xaliendx
  1226.         Static degree
  1227.         'movement routines of aliens
  1228.         If Not dead(index) Then
  1229.             'improve draw speed if turn off then on
  1230.             ImgAlien(index).Visible = False
  1231.              'flip picture of alien 0:=open arms 1:=closed arms
  1232.             ImgAlien(index).Picture = ImgAlienPic(Pic).Picture
  1233.             '
  1234.             degree = degree + 0.05
  1235.             If degree > 6.28 Then degree = 0
  1236.             'generate x move
  1237.             ImgAlien(index).Left = ImgAlien(index).Left + alienDx
  1238.             
  1239.             yaliendy = 5 * Sin(degree + index) + 5 * Cos(degree + index) + ImgAlien(index).Top
  1240.             xaliendx = 5 * Cos(degree + index) - 5 * Sin(degree + index) + ImgAlien(index).Left
  1241.             'ImgAlien(Index).Top = yaliendy
  1242.             Select Case alienmovetype 'from aliendownmove
  1243.             
  1244.             Case 1
  1245.                 'circle movement
  1246.                 ImgAlien(index).Move xaliendx, yaliendy
  1247.             Case 2
  1248.                 'y up and down
  1249.                 ImgAlien(index).Move ImgAlien(index).Left, yaliendy
  1250.             Case 3
  1251.                 'straight left to right
  1252.                 ImgAlien(index).Move ImgAlien(index).Left
  1253.             End Select
  1254.             ImgAlien(index).Visible = True
  1255.         End If
  1256. End Sub 'AlienMoveRoutines
  1257. Private Sub TurnAlienToScore(ByVal index)
  1258.     'turn alien into score 100
  1259.     ImgAlien(index).Picture = img100(Int(Rnd * 4)).Picture
  1260.     'move alien who is now a score -100- up screen
  1261.     If dead(index) Then
  1262.         ImgAlien(index).Visible = False
  1263.         ImgAlien(index).Top = ImgAlien(index).Top - 5
  1264.         ImgAlien(index).Visible = True
  1265.     End If
  1266.     'check and make invisible if dead off screen
  1267.     If ImgAlien(index).Top < 0 Then
  1268.         ImgAlien(index).Visible = False
  1269.         
  1270.     End If 'number100 if off screen upwards
  1271. End Sub 'turnalientoscore
  1272. Private Sub DetectCollisionPlayerMissileAlien(alienindex)
  1273.     Dim mcx, mcy, index, ImgGmcx, ImgGmcy, killed As Long
  1274.     'check aliens if visible if hit by playermissile
  1275.         If dead(alienindex) = False Then
  1276.             
  1277.             For index = 0 To 2 'cycle through missiles
  1278.                 If ImgPlayerMissile(index).Visible Then
  1279.                     'detect collision-playermissile and alien
  1280.                     If detectcol(ImgPlayerMissile(index), ImgAlien(alienindex)) _
  1281.                     Then
  1282.                         'make disapear=kill
  1283.                         
  1284.                         'hide missile
  1285.                         ImgPlayerMissile(index).Visible = False
  1286.                         'reduce bullets :only 3 fired per time
  1287.                         BulletOff = BulletOff + 1
  1288.                         ImgPlayerMissile(index).Top = -1
  1289.                         'picture of dead alien
  1290.                         ImgAlien(alienindex).Picture = ImgAlienPic(2).Picture
  1291.                         dead(alienindex) = True 'list of dead aliens
  1292.                         'killed = killed + 1 'record alien dead 0..16
  1293.                         Debug.Print "killed="
  1294.                         'detect if all aliens dead here
  1295.                         For x = 0 To 16
  1296.                         If dead(x) Then
  1297.                           killed = killed + 1
  1298.                            
  1299.                         End If
  1300.                         Next x
  1301.                         If killed = 17 Then '0..16
  1302.                             EndGame ("You Are A Winner: Another Game?")
  1303.                             Exit Sub
  1304.                         End If
  1305.                         score = score + 100
  1306.                         lblScore(4).Caption = score
  1307.                     End If 'if player hits alien
  1308.                     'if hit guidedmissile
  1309.                     If ImgGuidedMissile(0).Visible Then
  1310.                         'col detect playermissile and guidedmissile
  1311.                         If detectcol(ImgPlayerMissile(index), ImgGuidedMissile(0)) _
  1312.                         Then
  1313.                         'playermissile hits guided missile
  1314.                             ImgGuidedMissile(0).Visible = False
  1315.                             FireGuidedMissile = False
  1316.                             'adjust playermissiles
  1317.                             ImgPlayerMissile(index).Visible = False
  1318.                             'wait for all bullets to be off
  1319.                             BulletOff = BulletOff + 1
  1320.                             ImgPlayerMissile(index).Top = -1
  1321.                             score = score + 1000
  1322.                             lblScore(4).Caption = score
  1323.                                                 
  1324.                         End If
  1325.                     End If
  1326.                     If ImgWalker(0).Visible Then
  1327.                         'col detection imgplayermissile and walker
  1328.                         If detectcol(ImgPlayerMissile(index), ImgWalker(0)) _
  1329.                         Then
  1330.                         'player missile hits walker
  1331.                             ImgWalker(0).Picture = ImgWalker(9).Picture
  1332.                                                  
  1333.                             ImgWalker(0).Visible = False
  1334.                             walker = False
  1335.                           
  1336.                             ImgPlayerMissile(index).Visible = False
  1337.                             ImgPlayerMissile(index).Top = -1
  1338.                             BulletOff = BulletOff + 1
  1339.                             
  1340.                         End If
  1341.                     End If
  1342.                 
  1343.                 End If 'playermissile visible
  1344.             Next 'missile 0..2
  1345.         End If 'if alien alive and visible
  1346.         'limit bullets to 3
  1347.         If BulletOff >= 3 Then
  1348.             CanFire = True
  1349.             BulletIndex = 0
  1350.             BulletOff = 0
  1351.         End If
  1352. End Sub 'DetectCollisionPlayerMissileAlien
  1353. Private Sub DetectCollisionAlienPlayer()
  1354. Dim index, ImgGmcx, ImgGmcy As Long
  1355. Dim ImgAmicx, ImgAmicy 'alien missile centerx/y
  1356.     'alien missile center
  1357.     ImgAmicx = imgAlienMissile.Left + (imgAlienMissile.Width / 2)
  1358.     ImgAmicy = imgAlienMissile.Top + (imgAlienMissile.Height / 2)
  1359.     'col detect alien missile and player
  1360.     'If ImgAmicx >= ImgPlayer(0).Left And ImgAmicx <= ImgPlayer(0).Left + ImgPlayer(0).Width
  1361.     'And ImgAmicy >= ImgPlayer(0).Top And ImgAmicy <= ImgPlayer(0).Top + ImgPlayer(0).Height
  1362.     If detectcol(imgAlienMissile, ImgPlayer(0)) _
  1363.     Then
  1364.     'alien missile hits player
  1365.         imgAlienMissile.Top = ScaleHeight + 1
  1366.         
  1367.         imgAlienMissile.Visible = False
  1368.         ImgPlayer(0).Picture = ImgPlayer(5).Picture
  1369.         lives = lives - 1
  1370.         lblScore(5).Caption = "lives " & lives
  1371.         If lives = 0 Then
  1372.             EndGame ("Lost Lives-Another Game?")
  1373.             Exit Sub
  1374.         End If
  1375.     'ImgPlayer(0).Picture = ImgPlayer(1).Picture
  1376.     End If
  1377. 'alien missile center:check if alienmissile hits playermissile
  1378.     'ImgAmicx = imgAlienMissile.Left + (imgAlienMissile.Width / 2)
  1379.     'ImgAmicy = imgAlienMissile.Top + (imgAlienMissile.Height / 2)
  1380.     'checkplayermissiles
  1381.     For index = 0 To 2
  1382.         'If ImgAmicx >= ImgPlayerMissile(Index).Left And ImgAmicx <= ImgPlayerMissile(Index).Left + ImgPlayerMissile(Index).Width
  1383.         'And ImgAmicy >= ImgPlayerMissile(Index).Top And ImgAmicy <= ImgPlayerMissile(Index).Top + ImgPlayerMissile(Index).Height
  1384.         If detectcol(imgAlienMissile, ImgPlayerMissile(index)) _
  1385.         Then
  1386.         'alien missile hits playermissile
  1387.             imgAlienMissile.Top = ScaleHeight + 1
  1388.             imgAlienMissile.Visible = False
  1389.         
  1390.             score = score + 50
  1391.             lblScore(4).Caption = score
  1392.             plyrmssl = index 'which bullet to turn off
  1393.             ImgPlayerMissile(index).Picture = ImgPlayerMissile(4).Picture
  1394.             BulletOff = BulletOff + 1
  1395.             'delay for visual effect
  1396.             TmrMissileAnimation2.Enabled = True
  1397.         
  1398.         End If
  1399.     Next
  1400.     'guided missile detect:end game if hits player
  1401.     '
  1402.     If ImgGuidedMissile(0).Visible Then
  1403.         'If ImgGmcx >= ImgPlayer(0).Left And ImgGmcx <= ImgPlayer(0).Left + ImgPlayer(0).Width
  1404.         'And ImgGmcy >= ImgPlayer(0).Top And ImgGmcy <= ImgPlayer(0).Top + ImgPlayer(0).Height
  1405.         If detectcol(ImgGuidedMissile(0), ImgPlayer(0)) _
  1406.         Then
  1407.            ImgGuidedMissile(0).Visible = False
  1408.            EndGame ("GUIDED DEATH!!-Another Game?")
  1409.            Exit Sub 'added safety
  1410.     '--===bug on guided death must get out of loop
  1411.          ' make guided missile invisible! =solution!
  1412.         End If
  1413.     End If
  1414. End Sub 'DetectCollisionAlienPlayer
  1415. Private Sub AlienDownMove()
  1416. Dim index As Long
  1417.     'select type of move for alien in alienmovetmr event
  1418.     alienmovetype = Int(Rnd * 3) + 1
  1419.     'Debug.Print alienmovetype
  1420.     '
  1421.     'move alien down screen:triggered by tmralienmove
  1422.     For index = 0 To NoAliens
  1423.         If ImgAlien(index).Visible And dead(index) = False Then
  1424.             ImgAlien(index).Visible = False
  1425.             ImgAlien(index).Move ImgAlien(index).Left, ImgAlien(index).Top + 14
  1426.             ImgAlien(index).Visible = True
  1427.         End If
  1428.     Next
  1429. End Sub 'alienMoveDown
  1430. Private Sub EndGame(msg As String)
  1431.     Dim response
  1432.     Dim counter, index
  1433.     If msg = "You Are A Winner: Another Game?" Then
  1434.     Else
  1435.         lblEndGame.Visible = True ' don't show it if winner
  1436.     End If
  1437.     'whiteout player pic
  1438.     ImgPlayer(0).Picture = ImgPlayer(5).Picture
  1439.             '16=critical mark icon
  1440.     response = MsgBox(msg, vbYesNo + 16, "--------SPACEINVADERS--------")
  1441.     If response = vbYes Then 'we clicked yes
  1442.         Unload Me: Show 'reload and restart
  1443.     Else
  1444.        lblEndGame.Visible = True
  1445.        lblEndGame.Caption = "GOODBYE!" & Chr$(13) & "closing down"
  1446.        FrmGameScreen.Caption = "GOODBYE!"
  1447.        TmrEnergy1.Enabled = False
  1448.        TmrClock.Enabled = False
  1449.        TmrMissileAnimation2.Enabled = False
  1450.        TmrMoveAliens.Enabled = False
  1451.        TmrPlayerMissile.Enabled = False
  1452.        TmrEnd.Enabled = True 'make invisible all controls and destroy resources
  1453.         
  1454.         
  1455.     End If
  1456. End Sub 'EndGame
  1457. Private Sub TmrStart_Timer()
  1458. Static index
  1459. 'startmain
  1460. 'turn on visible controls and timers enabled
  1461.     If (TypeOf Controls(index) Is Label) Or (TypeOf Controls(index) Is CommandButton) _
  1462.     Or (TypeOf Controls(index) Is Image) Or (TypeOf Controls(index) Is Shape) _
  1463.     Or (TypeOf Controls(index) Is PictureBox) _
  1464.     Then
  1465.         'SV=for controls that Start Visible
  1466.         If Controls(index).Tag = "SV" Then
  1467.             FrmGameScreen.Controls(index).Visible = True
  1468.         End If
  1469.     End If
  1470.     'strange- controls.count starts at 0
  1471.     'so controls.count=88 but index 0..87
  1472.     index = index + 1
  1473.      If index = Controls.Count Then
  1474.         index = 0
  1475.         TmrEnergy1.Enabled = True
  1476.         TmrMoveAliens.Enabled = True
  1477.         TmrPlayerMissile.Enabled = True
  1478.         TmrClock.Enabled = True
  1479.         'turn me off
  1480.         TmrStart.Enabled = False
  1481.     End If
  1482. End Sub 'TmrStart
  1483. Private Sub CmdQuit_Click()
  1484. 'button to quit game screen
  1485.     Unload Me 'resource clean-up
  1486.     Set FrmGameScreen = Nothing
  1487.     End
  1488. End Sub 'CmdQuit-Click in frmgamescreen
  1489. Private Sub CmdHiScore_Click()
  1490.     Dim index, x, indexplayer, innum, tempindex As Long
  1491.     ' timer event still sent when form is modal so have to turn them off
  1492.     For index = 0 To Controls.Count - 1
  1493.         If TypeOf Controls(index) Is Timer Then
  1494.             Controls(index).Enabled = False 'turn all off     if timer
  1495.         End If
  1496.     Next
  1497.     FrmScores.Show (vbModal)  'stop everygame to look at score
  1498.     lblHiScore.Caption = "" 'prepare  table
  1499.     'go through players scores; sort scores
  1500.     For indexplayer = 0 To 3 'see if any player got higher score
  1501.        innum = players(indexplayer).score
  1502.         For index = 0 To 19
  1503.             
  1504.             If innum >= hiscore(index) Then
  1505.                 'shift other values down in array
  1506.                 tempindex = index
  1507.                 For x = 19 To tempindex + 1 Step -1
  1508.                     'go backwards in array
  1509.                     hiscore(x) = hiscore(x - 1)
  1510.         
  1511.                 Next
  1512.                 hiscore(tempindex) = innum
  1513.                 Exit For 'jump out of loop for if higher found
  1514.             End If
  1515.         Next
  1516.     Next indexplayer
  1517.     'display hi-table in label lblhiscore
  1518.     'lblHiScore.Visible = True
  1519.     For index = 0 To 3 'display 4 scores from array players()
  1520.         lblHiScore.Caption = lblHiScore.Caption & players(index).name & " : " & players(index).score & vbCrLf
  1521.     Next
  1522.     For index = 4 To 19 'display rest of players
  1523.         lblHiScore.Caption = lblHiScore.Caption & "player " & index & " : " & hiscore(index) & vbCrLf
  1524.     Next
  1525. End Sub 'CmdHiScore
  1526. '****************************End FrmGameScreen**************************
  1527.